Device for controlling an amount of light of a lighting unit for an endoscope

ABSTRACT

A device for controlling an amount of light of a lighting unit for use in an endoscope, used to view an image of an object. The device includes a light shield for shielding light generated by a light source and transmitted to the endoscope. A stepping motor drives the light shield for a series of predetermined time intervals. Brightness of the image is detected during each of the time intervals and pulses are generated during each of the time intervals. The number of pulses generated is determined in accordance with a difference between the brightness of the image detected during each of the time intervals and a desired brightness of the image. The pulses generated are used to drive the stepping motor in each of the plurality of time intervals.

The present application is a divisional of U.S. application No.08/512,399 filed on Aug. 8, 1995 which has since gone abandoned.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention is related to a device for controlling an amountof light transmitted from a light source of a video processor whichfunctions as a lighting unit for an endoscope.

2. Background of the Invention

In an endoscope, light is transmitted from a light source using a lightwave guide, such as an optical fiber cable, in order to illuminate anobject to be observed. In order to adjust the brightness of the observedimage, a device for controlling an amount of light transmitted from alight source to an incident surface of the light wave guide, isemployed. In a conventional endoscope, the light amount controllingdevice has a light shield which is rotated about an axis by a steppingmotor. The rotation of the light shield controls the amount of lightfrom the light source that is incident on the incident surface of theoptical fiber cable. With this type of light amount controlling device,the brightness of the observed image is detected periodically. Then, theposition of the light shield is adjusted such that the brightness of theobserved image is within an allowed brightness range.

Conventionally, the amount of light transmitted from the light source tothe endoscope is controlled by applying the same number of pulses to theinput of the stepping motor during each interrupt procedure (see FIG.11A). Therefore, the stepping motor and the light shield are rotated bythe same angular amount during each interrupt procedure. The process ofdetecting the brightness level, and driving the stepping motor to rotatethe light shield is repeated until the detected brightness is againwithin the allowed brightness range.

However, in the conventional endoscope, since the number of drivingpulses sent to the motor is constant during the execution of eachinterrupt procedure, if the number of pulses is set to a relativelysmall value, then the light shield will be moved slowly. This results inan increase in the response time of the light amount controlling device.

As shown in FIG. 11A, for example, each drive pulse rotates the motor0.5 degrees, three drive pulses are sent during each interrupt. Theinterrupts are executed every 50 ms. Thus, in order to rotate thestepping motor 10 degrees, seven interruption procedures are requiredfor a total time of 0.35 seconds. Further, since the number of pulsesmust be in multiples of three, the number of drive pulses cannot be 20,the optimum number, but must be 18 or 21. Therefore, the light shieldcannot be moved to the optimum position.

In order to decrease the response time of the light amount controllingdevice, the number of driving pulses sent to the stepping motor can beincreased. However, in this case, the light shield will be moved througha large angle of rotation and thus it may not be possible to adjust theamount of light such that the brightness level falls within the allowedbrightness range. This will result in the control system becomingunstable with unwanted back-and-forth oscillations (hereinafter referredto as hunting) occurring.

Further, as different types of endoscopes have different allowedbrightness ranges, different numbers of driving pulses are required inorder to properly adjust the amount of light transmitted from the lightsource.

Furthermore, for one type of endoscope, if the sending of apredetermined number of pulses to the stepping motor does not causehunting, in another endoscope, the predetermined number of pulses maynot be sufficiently low, and hunting may occur. Therefore, since thelight source may be connected with various types of endoscopes, thenumber of pulses may be set to the minimum number required for all typesof endoscopes in order to avoid the hunting problem. As a result, thespeed at which the brightness level can be adjusted for the types ofendoscopes is reduced.

SUMMARY OF THE INVENTION

It is therefore an object of the present invention to provide a devicefor controlling the amount of light produced by a lighting unit for usein an endoscope, in which the amount of light can be adjusted quicklyand accurately without causing hunting.

According to one aspect of the present invention, there is provided adevice for controlling an amount of light of a lighting unit for use inan endoscope, the endoscope being used to view an image of an object.The device includes a mechanism for shielding light generated by a lightsource and transmitted to the endoscope. A stepping motor drives thelight shielding means for a plurality of predetermined time intervals. Amechanism detects a brightness of the image during each of thepredetermined time intervals. Pulses are generated during each of thepredetermined time intervals. The number of the pulses generated controlan amount of driving of the stepping motor in each of the plurality ofpredetermined time intervals. The number of pulses generated by thepulse generating mechanism is determined in accordance with a differencebetween the brightness of the image detected during each of thepredetermined time intervals and a desired brightness of the image.

Therefore, a different number of pulses is generated when the differencein brightness of the detected image and the desired brightness changes.Preferably, when the brightness difference is large, a large number ofpulses is generated, and therefore the light shielding means is movedquickly. Then when the brightness difference is small, and the detectedbrightness if almost within an allowed brightness range, the number ofpulses generated is small. Therefore, the light shielding means is movedin smaller steps and hunting can be prevented.

In a preferred embodiment, a memory stores a first table of numbers ofpulses to be generated corresponding to a plurality of brightnessranges. Each of the brightness ranges are a range of differences betweenthe detected brightness of the image and the desired brightness of theimage. The memory can be a ROM or other static memory. Further, there isa unique number of pulses stored for each brightness range. Therefore,depending on the difference in brightness between the detected image andan input brightness level set by an operator, the number of pulses sentto the stepping motor will be different.

Since many types of endoscopes may be used with the lighting unit, thememory of the preferred embodiment stores a second table of numbers ofpulses to be generated which correspond to the plurality of brightnessranges. The second table of numbers of pulses is different from thefirst table of numbers of pulses, and corresponds to another type ofendoscope.

Further, the device includes a selector for selecting one of the firstand second tables.

In another preferred embodiment, the endoscope has a memory for storingthe type of the endoscope. The selector selects either the first orsecond table in response to the type of the endoscope stored in thememory.

This allows for easy selectability of the endoscope and facilitatesoperation of the device when used with the respective endoscope.Furthermore, the device is optimized for each endoscope that is attachedthereto.

In another preferred embodiment, the selector is manually actuable forselecting the type of endoscope.

According to a second aspect of the present invention, there is provideda device for controlling a device for controlling an amount of light ofa lighting unit for an endoscope, the endoscope being used to view animage of an object. The device includes a mechanism for shielding lightgenerated by a light source and transmitted to the endoscope. A steppingmotor drives the light shielding mechanism by a predetermined drivingamount for a plurality of time intervals. A mechanism sets a duration ofthe time interval to have one of a plurality of time values.

Therefore, by changing the time interval for driving the light shieldingmeans, the time required for adjusting the amount of light can bereduced, even if the amount of driving of the stepping motor is madesmall to prevent hunting.

In a preferred embodiment, the endoscope type is stored in a memory andthe duration of the time interval is set in accordance with the type ofthe endoscope. Therefore, the operation of the device can be optimizedfor each type of endoscope.

In another preferred embodiment, the time interval is set in accordancewith the position of a manually operable switch. This adds flexibilityto the operation of the device, and allows operation to be optimized forendoscopes that do not have the type stored in memory.

According to a third aspect of the present invention, there is provideda device for controlling an amount of light of a lighting unit for usein an endoscope, the endoscope being used to view an image of an object.The device includes a mechanism for shielding light generated by a lightsource and transmitted to the endoscope. A stepping motor drives thelight shielding mechanism for a plurality of predetermined timeintervals. A mechansim detects a brightness of the image during each ofthe predetermined time intervals. A predetermined number of pulses isgenerated during each of the predetermined time intervals, thepredetermined number of pulses being transmitted to the stepping motorduring each of the predetermined time intervals. An angular position ofthe light shielding means is determined. A phase of excitation of thestepping motor is varied in response to the determined angular position.

Therefore, by changing the number of phases of excitation of thestepping motor, the drive amount of the stepping motor in a givenpredetermined time interval can be changed.

In a preferred embodiment, the stepping motor is driven with 2 phaseexcitation when the angular position is less than or equal to apredetermined angular position. Otherwise, the stepping motor is drivenwith 1-2 phase excitation (i.e., excitation alternating between singlephase and two phase excitation at every pulse).

In another preferred embodiment, the phase of excitation of the steppingmotor is further varied in response to the detected brightness of theimage. In this case, even if the angular position is greater than thepredetermined angular position, if the brightness of the image is largerthan a predetermined value, the stepping motor is driven with 2 phaseexcitation to improve the speed at which the amount of light is reduced.This brings the detected image brightness into an allowed brightnessrange.

In another preferred embodiment, the phase of excitation of the steppingmotor is varied in response to the endoscope type. This optimizes theperformance of the device for each type of endoscope.

According to a fourth aspect of the present invention, there is provideda device for controlling an amount of light of a lighting unit for usein an endoscope, the endoscope being used to view an image of an object.The device includes a mechanism for shielding light generated by a lightsource and transmitted to the endoscope. A stepping motor drives thelight shielding mechanism for a plurality of predetermined timeintervals. A mechanism detects a brightness of the image during each ofthe predetermined time intervals. A mechanism inputs one of a pluralityof desired brightness of the image. A predetermined number of pulses isgenerated during each of the predetermined time intervals, thepredetermined number of pulses being transmitted to the stepping motor.One of a plurality of allowed brightness ranges of the image is set inaccordance with the input desired brightness of the image. Then, thedevice determines whether the detected brightness is within the setallowed brightness range.

Therefore, in a preferred embodiment, when the desired input brightnessof the image is high, the allowed brightness range is large. Since thechange in brightness of the image per unit rotation of the lightshielding mechanism is therefore small, the number of time intervalsrequired to adjust the amount of light such that the detected imagebrightness is within the allowed brightness range is reduced.

In another preferred embodiment, an angular position of the lightshielding mechanism is determined, and the allowed brightness range isset in response to the determined angular position of the lightshielding mechanism.

In yet another preferred embodiment, the type of endoscope is determinedand the allowed brightness range is also set in response to thedetermined endoscope type.

According to a fifth aspect of the present invention, there is provideda device for controlling an amount of light of a lighting unit for usein an endoscope, the endoscope being used to view an image of an object.The device includes a mechanism for shielding light generated by a lightsource and transmitted to the endoscope. A stepping motor drives thelight shielding mechanism for a plurality of predetermined timeintervals. A mechanism detects a brightness of the image during each ofthe predetermined time intervals. A mechanism inputs a desiredbrightness of the image. Pulses are generated during each of thepredetermined time intervals; a number of the pulses generated are usedto drive the stepping motor in each of the plurality of predeterminedtime intervals. The number of pulses generated by the pulse generator isdetermined in accordance with the input desired brightness of the image.

Therefore, since the change in brightness per unit rotation of the lightshielding means increases as the brightness of the image decreases whenthe input brightness level is high, the light shielding mechanism canhave a higher driving amount than when the brightness of the image islow. This will improve the speed at which the amount of light can beadjusted, without introducing a hunting problem.

Alternatively, the number of pulses generated can be determined inaccordance with an angular position of the light shielding mechanism.

Optionally, the number of pulses generated can be further determined inaccordance with the type of endoscope.

According to a sixth aspect of the present invention, there is provideda device for controlling an amount of light of a lighting unit for usein an endoscope, the endoscope being used to view an image of an object.The device includes a mechanism for shielding light generated by a lightsource and transmitted to the endoscope. A stepping motor drives thelight shielding mechanism for a plurality of predetermined timeintervals. A mechanism detects a brightness of the image during each ofthe predetermined time intervals. A mechanism detects hunting of thestepping motor. Pulses are generated during each of the predeterminedtime intervals, a number of the pulses generated being used to drive thestepping motor in each of the plurality of predetermined time intervals.A number of pulses generated by the pulse generator during each of thepredetermined time intervals is determined in response to hunting beingdetected by the hunting detector, the determined number of pulses beingreduced when the hunting is detected.

Therefore, if hunting is detected, by reducing the number of pulses sentto the stepping motor, the driving amount of the stepping motor isreduced, and the hunting problem can be overcome.

Optionally, the device determines whether the brightness of the image islarger than a desired brightness of the image. A first value is outputif the detected brightness is larger than the desired brightness, and asecond value if the detected brightness if not larger than the desiredbrightness. Each output value is stored in a register of a memory. Thedevice then determines if hunting occurred by examining the registers ofthe memory. If the registers sequentially store both the first andsecond values, then hunting has occurred.

By using a memory to store the information, detection of hunting can beperformed quickly, since the response time of the stepping motor doesnot effect the detection of hunting.

Alternatively, data relating to a direction (i.e., forward and reverse)of the stepping motor can be stored in a register of another memory. Ifthe registers sequentially store both the forward and reverse data, thenhunting has occurred.

According to a seventh aspect of the present invention, there isprovided a device for controlling an amount of light of a lighting unitfor use in an endoscope, the endoscope being used to view an image of anobject. The device includes a plurality of light shields for shieldinglight generated by a light source and transmitted to the endoscope. Astepping motor drives the plurality light shields for a plurality ofpredetermined time intervals. A mechanism detects a brightness of theimage during each of the predetermined time intervals. A predeterminednumber of pulses is generated during each of the predetermined timeintervals. The pulses are used to control an amount of driving of thestepping motor in each of the plurality of predetermined time intervals.A difference between the brightness of the image detected and a desiredbrightness of the image determines which of the plurality of lightshields is to be driven by the stepping motor.

Therefore, if the difference in brightness is large, two or more lightshields may be moved, thereby increasing the speed at which the amountof light is varied. Conversely, if the difference in brightness issmall, then only one light shield is moved to bring the detected imagebrightness into an allowed brightness range. Since the number of lightshields driven can be changed at each time interval, the amount of lightcan initially be varied quickly, and then varied accurately in order toprevent hunting.

Alternatively, light shields having different effects on the change inbrightness per degree of rotation can be employed. In this case, thelight shields which has the greatest effect on the change in brightnessper degree of rotation is driven in order to quickly change the detectedimage brightness. Then another light shield having less effect can bedriven in order to change the detected image brightness more accurately,until the detected image brightness is in the allowed brightness range.

In the preferred embodiments, the light shields rotate on different axisof rotation.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a schematic diagram of an endoscope and video processorwhich functions as a lighting unit for the endoscope, employing a lightamount controlling device of the present invention;

FIG. 2 is a perspective view of a light shield used in the light amountcontrolling device shown in FIG. 1;

FIG. 3 is a side view of the light shield shown in FIG. 2;

FIG. 4 shows a block diagram of a motor control circuit of the lightamount controlling device shown in FIG. 1;

FIG. 5 shows a schematic diagram of a microprocessor used in the videoprocessor shown in FIG. 1;

FIG. 6 shows a table of input brightness level values and correspondingreference values stored in a ROM of the microprocessor shown in FIG. 5;

FIG. 7 shows a table, stored in the ROM of the microprocessor shown inFIG. 5, showing a number of driving pulses output to a stepping motor ofthe light amount controlling device shown in FIG. 1, for differentbrightness ranges;

FIG. 8 shows a flowchart of a main program stored in the ROM of themicroprocessor, shown in FIG. 5;

FIG. 9 shows a flowchart of an interrupt procedure used to control adriving of the stepping motor of the light amount controlling device,according to a first embodiment of the present invention;

FIG. 10A shows a flowchart of a process for determining a number ofpulses to send to the stepping motor, according to the first embodimentof the present invention;

FIG. 10B shows a flowchart of a process carried out to determine anumber of pulses to send to the stepping motor, according to amodification of the first embodiment of the present invention;

FIG. 11A shows a timing diagram of the drive control of the steppingmotor of the prior art;

FIG. 11B shows a timing diagram of the drive control of the steppingmotor, according to the first embodiment of the present invention;

FIGS. 12 and 13 show flowcharts of a subroutine for performing endoscopeoperations, called from the main program shown in FIG. 8, according to asecond embodiment of the present invention;

FIGS. 14A and 14B show timing diagrams of the drive control of thestepping motor, according to the second embodiment of the presentinvention;

FIG. 15 shows a flowchart of a main program stored in the ROM of themicroprocessor, shown in FIG. 5, according to a third embodiment of thepresent invention;

FIG. 16 shows a flowchart of a subroutine for a controlling the amountof light, according to the third embodiment of the present invention;

FIG. 17 shows a graph of a relationship between a rotation angle of thestepping motor and a brightness of an image observed using theendoscope;

FIG. 18 shows an enlarged portion of the graph shown in FIG. 17;

FIG. 19 shows a flowchart of an interrupt procedure used to control adriving of the stepping motor of the light amount controlling device,according to a fourth embodiment of the present invention;

FIG. 20A shows a flowchart of a process for determining a number ofphases of excitation of the stepping motor, according to the fourthembodiment;

FIG. 20B shows a flowchart of a process for determining a number ofphases of excitation of the stepping motor, according to a modificationof the fourth embodiment;

FIG. 21 shows a table, stored in the ROM of the microprocessor shown inFIG. 5, showing a relationship between a counter, an angle of rotationof the stepping motor, and a brightness of the lighting unit, accordingto the fourth embodiment of the present invention;

FIG. 22 is a perspective view of a light shield used in a modificationof the fourth embodiment of the present invention;

FIG. 23 is a side view of the light shield shown in FIG. 22;

FIG. 24 shows a graph of a relationship between a rotation angle of thestepping motor and a brightness of an image observed using the lightshield shown in FIG. 22;

FIG. 25 shows a graph of a brightness of an object observed by threedifferent types of endoscopes, as a function of an angle of rotation ofthe stepping motor;

FIG. 26 shows a flowchart of an interrupt procedure used to control adriving of the stepping motor of the light amount controlling device,according to a fifth embodiment of the present invention;

FIG. 27 is a table showing a relationship between a change in brightnessof an object, and an angle of rotation of the stepping motor,corresponding to a graph A shown in FIG. 25;

FIG. 28 shows an enlarged portion of the graph shown in FIG. 25;

FIG. 29 shows a flowchart of a process for determining a number ofpulses to send to the stepping motor, according to the fifth embodimentof the present invention;

FIG. 30 is a table showing a relationship between an angle of rotationof the stepping motor and a change in brightness level, according to afirst modification of the fifth embodiment of the present invention;

FIG. 31 shows a flowchart of a process for determining a number ofpulses to send to the stepping motor, according to the firstmodification of the fifth embodiment of the present invention;

FIG. 32 is a table showing the relationship between an angle of rotationof the stepping motor and a change in brightness of the lighting unit,for different types of endoscopes, according to a second modification ofthe fifth embodiment of the present invention;

FIG. 33 shows a flowchart of a process for determining a number ofpulses to send to the stepping motor, according to the secondmodification of the fifth embodiments of the present invention;

FIG. 34 is a table showing a relationship between a change in brightnessof an object, and an angle of rotation of the stepping motor, accordingto a sixth embodiment of the present invention;

FIG. 35 shows another enlarged portion of the graph shown in FIG. 25;

FIG. 36 shows a flowchart of a process for determining a number ofpulses to send to the stepping motor, according to a sixth embodiment ofthe present invention;

FIG. 37 is a table showing a relationship between an angle of rotationof the stepping motor and a change in brightness level, according to afirst modification of the sixth embodiment of the present invention;

FIG. 38 shows a flowchart of a process for determining a number ofpulses to send to the stepping motor, according to a first modificationof the sixth embodiment of the present invention;

FIG. 39 is a table showing the relationship between an angle of rotationof the stepping motor and a change in brightness of the lighting unit,for different types of endoscopes, according to a second modification ofthe sixth embodiment of the present invention;

FIG. 40 shows a flowchart of a process for determining a number ofpulses to send to the stepping motor, according to the secondmodification of the sixth embodiment of the present invention;

FIGS. 41 and 42 show a flowchart of an interrupt procedure used tocontrol a driving of the stepping motor of the light amount controllingdevice, according to a seventh embodiment of the present invention;

FIG. 43 illustrates two registers used for storing data, employed in theseventh embodiment of the present invention;

FIG. 44 shows a flowchart of an interrupt procedure used to control adriving of the stepping motor of the light amount controlling device,according to a modification of the seventh embodiment of the presentinvention;

FIG. 45 shows a flowchart of a process for determining a number ofpulses to send to the stepping motor, according to an eighth embodimentof the present invention;

FIGS. 46A and 46B show a flowchart of an interrupt procedure used tocontrol a driving of the stepping motor of the light amount controllingdevice, according to a modification of the eighth embodiment of thepresent invention;

FIG. 47 shows a schematic diagram of an endoscope and video processorwhich employ a light amount controlling device of the present invention,according to a ninth embodiment of the present invention;

FIG. 48 is a perspective view of light shields used in the light amountcontrolling device shown in FIG. 47;

FIG. 49 shows a schematic diagram of a microprocessor used in the videoprocessor shown in FIG. 47;

FIG. 50 shows a flowchart of an interrupt procedure used to control adriving of the stepping motor of the light amount controlling device,according to the ninth embodiment of the present invention;

FIG. 51 is a perspective view of another set of light shields used in amodification of the ninth embodiment; and

FIG. 52 shows a flowchart of an interrupt procedure used to control adriving of the stepping motor of the light amount controlling device,according to the modification of the ninth embodiment of the presentinvention.

DESCRIPTION OF THE EMBODIMENTS

FIG. 1 shows a structure of an endoscope 1 attached to a video processor20. The video processor 20 functions as a lighting unit for theendoscope 1. The endoscope 1 includes an objective lens 2 and an imagereceiving element 3, such as a CCD (Charge Coupled Device). Further,light from a lamp 22 of the video processor is directed by a light waveguide 4 (such as an optical fiber cable), and a lens 5, to be incidenton an object that is to be viewed using the endoscope 1. The lens 5increases the angular dispersion of the light emitted by the light waveguide 4.

A connector 6 of the endoscope 1 is detachably connected to videoprocessor 20. The connector 6 includes an electronic connector 7, whichelectrically connects the image receiving element 3 to the videoprocessor 20.

The video processor 20 includes an image signal processing circuit 21,the lamp 22, a lamp control circuit, a converging lens 24, a lightshield 25, a motor 26, a motor control circuit 28, an A/D converter 42and a microprocessor 30.

A switch panel 201 is provided with (1) an auto/manual switch forswitching a control mode of the brightness of the observed screenbetween a manual mode and an automatic mode, and (2) an up/down switchfor increasing/decreasing the brightness level of the observed screenover a range of 10 levels.

The image signal processing unit 21 receives an image signal from theimage receiving element 3, processes the image signal and outputs avideo signal to a monitor 49. Further, a brightness signal correspondingto the received image signal is transmitted to an A/D converter 42, andconverted to a digital signal and sent to the microprocessor 30.

The lamp 22, which is controlled by the light source control circuit,emits light towards the light wave guide 4. The brightness level of thelight emitted by the lamp 22 is modified in accordance with the positionof the light shield plate 25 relative to the lamp 22. The light is thenconverged by the converging lens 24 and is incident on an RGB filter 23.

The light shield 25 is rotated about an axis by the motor 26. Therotation of the light shield 25 changes the cross-sectional area of thelight flux that is transmitted from the lamp 22 to the converging lens24. The motor 26 is a stepping motor, and is controlled by the motorcontrol circuit 28.

The RGB filter 23 is disk shaped and rotates about an axis. The RGBfilter 23 has red (R) filters, green (G) filters and blue (B) filtersarranged sequentially around the disk. The rotation of the RGB filter 23is controlled by the filter driving circuit 29.

The microprocessor 30 controls the operation of the video processor 20and the endoscope 1.

FIG. 2 is a perspective view of the light shield 25 and the steppingmotor 26. The light shield 25 is a thin plate having a U-shape. Thebottom surface of the U-shaped plate is secured to a spindle 251 of thestepping motor 26. The axis of the spindle 251 is perpendicular to theoptical axis of a light path L (see FIG. 3).

FIG. 3 is a side view of the light shield 25 and the stepping motor 26as viewed along the optical axis. As shown in FIG. 3, when the verticalsurfaces of the light shield 25 are parallel to the optical axis, thelight path L of the light is hardly shaded by the light shield 25.

By rotating the light shield 25, the amount of light transmitted fromthe lamp 22 to the converging lens 24 is changed.

FIG. 4 shows a block diagram of the motor control circuit 28. The motorcontrol circuit 28 includes a pulse control circuit 281 and a motorcontrol circuit 282.

The pulse control circuit 281 receives a direction signal indicating adirection in which the stepping motor 26 is rotated, and a referencepulse signal. The reference pulse signal is modified and sent to themotor 26 from the CPU 30 through an I/O port 41. A phase switchingsignal determines whether a 2-phase excitation or 1-2 phase excitationmethod is used, when driving the stepping motor 26.

The direction signal indicates the direction that the stepping motor 26is to be rotated. A forward direction signal results in the steppingmotor 26 being rotated in a forward direction. The light shield 25 isalso rotated in the forward direction, thereby reducing the amount oflight emitted by the lighting unit along the light path L.

Conversely, a reverse signal results in the stepping motor 26 beingrotated in a reverse direction. The light shield 25 is also rotated inthe reverse direction, thereby increasing the amount of light emitted bythe lighting unit along the light path L. In response to the receivedinstruction signal, the motor driving circuit 282 outputs driving pulsesaccording to a predetermined excitation method for driving the steppingmotor 26 synchronously with the driving pulse signal transmitted fromthe pulse control circuit 281.

FIG. 5 shows a configuration of the microprocessor 30. Themicroprocessor 30 includes a CPU (Central Processing Unit) 31 and asystem bus 32. A ROM (Read Only Memory) 33 stores programs to beexecuted, a RAM (Random Access Memory) 34, an RTC (Real Time Clock) 35,etc. are connected to the system bus 32.

Character data stored in a VRAM (Video Random Access Memory) 36 istransmitted to a CRTC (Cathode Ray Tube Microprocessor) 37, combinedwith the image data output by the image processing circuit 21, andviewed on the monitor 49.

The switch panel 201 of the video processor 20, an external keyboard 202and the lamp control circuit, for controlling the lamp 22 are alsoconnected to the system bus 32 through the I/O ports 38, 39 and 40,respectively.

The motor control circuit 28 receives/transmits signals through the I/Oport 41. A brightness signal indicating the brightness of the observedscreen which is output by the image signal processing circuit 21 isconverted from an analog signal to a 256-step digital signal by ananalog-digital converter 42, and then transmitted to the microprocessor30.

By connecting the connector 6 with the video processor 20, a memory 9provided inside the endoscope 1 is connected to the microprocessor 30through an I/O port 43. The memory 9 stores data intrinsic to theendoscope 1, such as data which indicates the endoscope type.

A DIP switch 11 is connected with the I/O port 43. By turning the DIPswitch 11 on or off, the input impedance of the I/O port 43 is toggledbetween a high or low level.

A programmable interval timer PIT 44 which can be programmed withdifferent time intervals, is connected to the system bus, for providingthe timing interval of the interrupt routine. A counter output terminalof the PIT 44 sends an interrupt to the CPU 31 at the programmed timeintervals.

FIG. 6 shows a table of the input brightness levels IBL and referencevalues stored in the ROM 33. A brightness level of one through ten isselected by using the switch panel 201. The brightness level is thelevel of the brightness of the image of object observed on the monitor49. The microprocessor 30 then sets a reference value corresponding tothe brightness level. The reference values corresponding to thebrightness levels are stored in the ROM 33.

The microprocessor 30 then compares the brightness signal output by theimage signal processing circuit 21 and converted by the A/D converter 42with the reference value. If necessary, microprocessor 30 controls themotor control circuit 28 to drive the stepping motor 26, therebyrotating the light shield 25, to change the amount of light emitted bythe lighting unit of the endoscope.

FIG. 7 shows a table of the number of driving pulses output to thestepping motor 26 for a given brightness difference, according to afirst embodiment of the present invention. The given brightnessdifference is defined as the absolute value of the difference betweenthe digital brightness signal and the reference values stored in the ROM33. The ROM 33 also stores eight values of the number of driving pulses,corresponding to the brightness difference, in two ROM tables (i.e., ROMtable 1 and ROM table 2).

When the brightness difference is small, the number of driving pulsesstored in both ROM tables is small. As the brightness differenceincreases, the number of driving pulses stored in both ROM tablesbecomes larger. However, for large brightness differences, the values ofthe number of driving pulses stored in ROM table 1 are larger than thecorresponding number of driving pulses stored in ROM table 2.

FIG. 8 shows a flowchart of a main program stored in the ROM 33,according to the first embodiment of the present invention.

A predetermined initialization routine is executed in step S80. Then,steps S81 and S82 execute a procedure set by the switch panel 201 and akeyboard input, respectively. A procedure for controlling an operationof the lamp controlling circuit 27 is then executed in step S83.

Step S84 executes a normal operation of the endoscope 1, while step S85executes a procedure for displaying the date and time. Other proceduresare executed in step S86. The process then repeats.

In the first embodiment, information transmitted from the memory 9 ofthe endoscope 1 to the I/O port 43 is used for determining which one ofthe ROM tables 1 or 2 is used.

When the endoscope 1 is connected to the video processor 20, during theprocedure of step S84, the endoscope type is read out of the memory 9.The information is substituted for a predetermined variable and storedin the RAM 34.

STEPPING MOTOR DRIVEN USING A LOOKUP TABLE

FIG. 9 shows a flowchart illustrating the drive control of the steppingmotor 26 according to the first embodiment of the present invention. Thedrive control of the stepping motor 26 is an interruption procedureexecuted at predetermined intervals. In this first embodiment, thepredetermined interval is 0.05 seconds (i.e., 50 ms).

Initially in step S90, the brightness signal is transmitted from theimage signal processing circuit 21. The brightness signal is thenconverted to a brightness value BV, in step S91. Also in step S91, aninput brightness level IBL, which is set by an operator of the endoscope1, is used to generate a reference brightness value, RV. Step S92 thencompares the reference value RV with the brightness value BV todetermine whether the brightness value BV is within an allowedbrightness range β (i.e., step S92 determines whether |RV-BV|>β).

If the brightness value BV of the observed image is within the allowedrange (S92:N) with respect to the input brightness level IBL, theinterruption procedure is terminated and control returns to the mainprogram.

If the difference between the brightness value BV and the referencevalue RV exceeds the allowed range (S92:Y), then step S93 determineswhether the brightness value BV is greater than the reference value RV.If the brightness value BV is greater than the reference value RV(S93:Y), a forward rotation signal is sent to the motor control circuit28 in step S94. This results in the light shield 25 being rotated suchthat the amount of light emitted by the lighting unit is made smaller.

Conversely, if the brightness value BV is smaller than the referencevalue RV (S93:N), a reverse rotation signal is sent to the motor controlcircuit 28 in step S95. This results in the light shield 25 beingrotated such that the amount of light emitted by the lighting unit ismade larger.

Step S96 determines the number of drive pulses to be sent to the motorduring the interrupt routine. The number of pulses is determined inaccordance with the difference between the brightness of the imagesignal processed by the image signal processing circuit 21, and thereference value. The number of pulses which corresponds to thedifference on brightness is then read out from one of the ROM tables 1or 2. Further, the use of ROM table 1 or 2 is determined by the type ofendoscope being used, as explained in more detail below.

Then, in step S97, the number of drive pulses determined in step S96 issent to the stepping motor 26 and the interruption procedure isterminated.

FIG. 10A shows the process carried out in step S96, in order todetermine the number of drive pulses to be sent to the pulse controlcircuit 281, according to the first embodiment.

Step S100 determines whether the type of endoscope 1 connected to thevideo processor 20, is used in the digestive system. The datacorresponding to the endoscope type is stored in the memory 9 of theendoscope 1.

If the type of endoscope corresponds to one used for the digestivesystem (S100:Y), then ROM table 1 is used for determining the number ofpulses for driving the stepping motor 26 in step S101. If the type ofendoscope is for a system (i.e., such as the respiratory system) otherthan the digestive system (S100:N), then ROM table 2 is used fordetermining the number of pulses for driving the stepping motor 26, instep S102. Then control proceeds to step S97.

As described above, if the difference between the brightness value BVand the reference value RV is relatively large, a greater number ofpulses are applied to the stepping motor 26 and therefore the lightshield 25 rotates at a high speed during one interrupt procedure. Whenthe difference between the brightness signal value and the referencevalue is relatively small, a smaller number of pulses are applied to thestepping motor 26. In the latter case, since the light shield 25 isrotated by a small amount during one interrupt procedure, the lightshield 25 can be easily positioned at the optimum location.

Further, the number of pulses sent to the stepping motor 26 is differentdepending on the type of endoscope being used. Therefore, the control ofthe stepping motor 26 can be optimized for each type of endoscope.

FIG. 10B shows the process carried out in step S96, in order todetermine the number of drive pulses to be sent to the stepping motor 26according to a modification of the first embodiment.

In modification of the first embodiment, the type of endoscope isdetermined in accordance with a position of the DIP switch 11. Bysetting the DIP switch 11 to one of two positions, the type of endoscopemay be set.

Therefore, step S103, which is similar to step S100, determines whetherthe type of endoscope 1 connected to the video processor 20 is used inthe digestive system.

If the type of endoscope corresponds to one used for the digestivesystem (S103:Y), then ROM table 1 is used for determining the number ofpulses for driving the stepping motor 26 in step S104. If the type ofendoscope is for a system (i.e., such as the respiratory system) otherthan the digestive system (S103:N), then ROM table 2 is used fordetermining the number of pulses for driving the stepping motor 26, instep S105. Then control proceeds to step S97.

Therefore, by employing a simple circuit, the type of endoscope may beeasily selected by an operator. Further, since the type of endoscope canbe selected, the control of the stepping motor 26 can be optimized foreach type of endoscope, as explained above.

FIG. 11B is a timing chart showing the drive control of the steppingmotor 26 according to the first embodiment. The chart shows an examplewhen the stepping motor 26 is rotated 10 degrees. In this example, it isassumed that the stepping motor 26 rotates 0.5 degrees for every drivepulse. According to the first embodiment, as shown in FIG. 11B, thenumber of pulses at every interruption procedure changes (i.e., 8, 4, 4,2 and 2). As shown in FIG. 11B, only five interruption procedure arerequired, for a total time of 0.25 seconds. Furthermore, the lightshield 25 is positioned at the optimum position, since the number ofdriving pulses is not limited to a multiple of three.

As described above, the stepping motor 26 is driven during fiveinterrupt procedures. The number of pulses sent to the stepping motor 26during each interrupt is determined from the ROM table 1 or 2. However,by programming another ROM table having different numbers of pulsescorresponding to the range of brightness differences, all 20 pulsescould have been sent to the motor during the first interrupt procedure.The number of pulses sent to the stepping motor 26 is only limited bythe period of pulse and the interval between successive interrupts.

If the type of endoscope used is for the digestive system, the objectivearea is relatively wide and the object distance fluctuates. In thiscase, by using ROM table 1, the endoscope quickly responds to the changein the object distance. If the type of endoscope used is not for thedigestive system, then the observing area is fairly narrow with a stableobject distance. In this case, by using ROM table 2, the brightness canbe precisely adjusted.

As described above, by adjusting the number of pulses sent to thestepping motor 26 in accordance with a difference between the brightnessvalue BV and the reference brightness value RV, the amount of lightemitted by the lighting unit can be changed quickly, thereby improvingthe response time of the endoscope. Further, since the number of stepscan be reduced when the detected brightness is only slightly out of theallowed brightness range, the precision of control of the light amountis increased without reducing the response time of the endoscope.Furthermore, the stability of the control of the light amount isimproved, and hunting is prevented.

In the first embodiment described above, two types of endoscopes arecategorized (i.e., those used for the digestive system, and all otherendoscopes). However, it is possible to have more than two categories ofendoscopes, in which case, more than two ROM tables of stored numbers ofdriving pulses would be required.

ADJUSTABLE INTERVALS BETWEEN SUCCESSIVE INTERRUPTS

FIG. 8 also illustrates a flowchart of a main program according to asecond embodiment of the present invention. FIGS. 12 and 13 illustrate aflowchart of a subroutine of the endoscope operations called from stepS84 of the main program shown in FIG. 8.

In the second embodiment, the PIT 44 is programmed with one of twodifferent interval timing values depending on the type of endoscope 1that is connected to video processor 20. Further, a flag U1 is set equalto 1 when the endoscope 1 is connected to the video processor 20, and isset equal to 0 when the endoscope 1 is not connected to the videoprocessor 20.

Step S120 determines whether the endoscope 1 is currently connected tothe video processor 20, by examining the setting of the flag U1. Thesetting of the flag U1 is changed when the change in the physicalconnection of the endoscope 1 to the video processor 20, is detected. IfU1 is equal to 0 (S120:Y), then the endoscope 1 is not currentlyconnected to the video processor. Step S121 then monitors the connectionstatus of the endoscope 1 to the video processor 20. If the endoscope 1is not connected to the video processor 20 (S121:N), then the routineends and control returns to the main program.

If the endoscope 1 is connected to the video processor 20 (S121:Y), thenU1 is set equal to 1 step S122. Step S123 then determines the type ofendoscope 1 connected to the video processor 20. The process carried outin this step is shown in FIG. 13, and will be described in more detaillater. Then, the name of the endoscope type is displayed on the monitor49, in step S126, and the routine ends.

In step S120, if the endoscope 1 was currently connected to the videoprocessor 20 (S120:N) then step S127 monitors the connection status ofendoscope 1 to the video processor 20. If the endoscope 1 remainsconnected to the video processor 20 (S125:Y), then the routine ends andcontrol returns to the main program.

If the endoscope 1 is disconnected from the video processor 20 (S125:N),then U1 is set to 0 in step S126, and the name of the type of endoscopeis cleared from the display on the monitor 49, in step S127. The routinethen ends and control returns to the main program.

FIG. 13 shows the process carried out in step S123 in more detail.

Step S130 determines whether the endoscope 1 is the type used for thedigestive system. In the second embodiment, the type of endoscope can bedetermined using data stored in the memory 9, or by a setting of the DIPswitch 11.

If the endoscope 1 is the type used for the digestive system (S130:Y)then the PIT counter 44 has a count value n set equal to N1 in stepS131. Otherwise, when the endoscope 1 is a different type of endoscope(S130:N), the count value n is set equal to N2 in step S132.

As described above, the interrupt time interval can be programmed in thePIT 44 to have one of two values, depending on the type of endoscopeconnected to the video processor 20. In the second embodiment, the twotime interval values are 50 ms and 90 ms. Further, the number of pulsesused to drive the stepping motor 26 is the same for each type ofendoscope.

The interrupt routine used to control the drive of the stepping motor 26in the second embodiment is similar to the drive control of the steppingmotor 26 in the first embodiment, described above and shown in FIG. 9.However, in step S96, the number of pulses to drive the stepping motoris a fixed value.

FIGS. 14A and 14B show timing diagrams of the drive control of thestepping motor 26 for an endoscope used for the digestive system, andanother type of endoscope, such as an endoscope used for the respiratorysystem, respectively.

When using the endoscope for the digestive system, since the area to beobserved in the digestive system is relatively wide and the objectdistance varies frequently, in the interruption time interval is set to50 ms. Therefore, the light shield 25 can be moved quickly in responseto a change in the object distance.

When using the endoscope for a different system, such as the respiratorysystem, since the area to be observed is small and the object distanceis stable, the interruption time interval is set to 80 ms. Therefore,the light shield 25 can be moved with greater accuracy.

FIG. 15 illustrates a main program of the operation of a thirdembodiment of the present invention. In the third embodiment, the motordrive control is executed as a part of a subroutine for controlling theamount of light emitted by the lighting unit, and not as an interruptprocedure. Further, in this embodiment, the DIP switch 11 sets thevalues N1 and N2, using software in the microprocessor 30, in order toset the time interval between executions of the subroutine.

The main program for the third embodiment is similar to the main programfor the first embodiment, shown in FIG. 8, with steps S150 through stepsS155 the same as steps S80 through S85.

Thus, in step S150, the predetermined initialization routine isexecuted. Then, steps S151 and S152 execute a procedure set by theswitch panel 201 and a keyboard input, respectively. A procedure forcontrolling an operation of the lamp controlling circuit 27 is thenexecuted in step S153.

Step S154 executes a normal operation of the endoscope 1, while stepS155 executes a procedure for displaying the date and time. In stepS156, the subroutine for controlling the amount of light emitted by thelighting unit is called, and other processing is executed in step S157.The program is then repeated.

In step S154 of the main program, the subroutine called to perform theendoscope operations is similar to the subroutine in the secondembodiment, shown in FIG. 12. However, in step S123, only the type ofendoscope is determined (i.e., by reading the memory 9, or from asetting of the DIP switch 11), since the values N1 and N2 are setpreviously using the DIP switch 11.

FIG. 16 shows a flowchart of a subroutine for controlling the amount oflight emitted by the lighting unit, which is called in step S156 of themain program. In this routine a variable c is used as a counter. In stepS160, the value of c is incremented by 1 (one). Step S161 determineswhether the DIP switch 11 is OFF. If the DIP switch 11 is OFF (S161:Y),then c is divided by the value N1 in step S162, and a remainder REM isobtained. If the DIP switch 11 is ON (S161:N), then c is divided by thevalue N2 in step S163, and the remainder REM is obtained. Then, stepS164 determines whether the remainder REM is equal to 0 (zero). If REMis equal to 0 (S164:Y), the motor driving subroutine shown in FIG. 9 iscalled in step S165, and then the routine ends. If REM is not equal to 0(S164:N), the routine ends.

Thus, in the third embodiment, the interval at which the motor drivingpulses are applied is controlled by the setting of the DIP switch 11.If, for example, N1 is set equal to 17 when the DIP switch 11 is turnedOFF; the motor driving procedure is then executed approximately every 50ms. Further, if N2 is set equal to 27 when the DIP switch is turned ON,then the motor driving procedure is executed approximately every 80 ms.

In the third embodiment, the DIP switch 11 can usually be set to its OFFposition. Therefore, the control of the light amount emitted by thelighting unit is executed more frequently, and has a faster responsetime. If the light shield 25 does not coverage to a certain position asa result of a change in a characteristic of the light amount controllingdevice when the endoscope type is changed or the lamp is changed, byturning the DIP switch 11 ON, the hunting condition will be prevented.

In the above-described embodiment, with the DIP switch 11, one of onlytwo conditions is selectable. However, more than two conditions, or morethan two constants Nn (n=1, 2, 3, . . . ) can be used. In this case, theoptimum time interval of driving the motor 26 can be selected dependingon the kind of the endoscope, ambient conditions, mechanicalcharacteristics, and/or preferences of an operator.

According to the third embodiment, since the time interval of the motordriving procedure is varied, the response of the movement of the lightshield 25 can be made as quickly as possible without hunting. Further,even if hunting occurs as a result of a slow response in the changing ofthe brightness after driving the stepping motor 26, by elongating thetime period, and without changing the software or hardware, theoperation of the light amount controlling device can be made stable.

Further, as described above, the motor driving operation can be executedas an interruption procedure or a part of a normal procedure.Furthermore, the time interval can be determined in software or by amanual operation, or in accordance with the type of endoscope attachedto the video processor, or by setting a DIP switch. The setting of thetime interval is not, however, limited to these methods, but may anothermethod, such as direct data entry etc.

PHASE CONTROLLED DRIVING EMBODIMENTS

FIG. 17 shows the curve y=f(θ) which is the relationship between therotation angle θ and the brightness signal value (A/D converted value) yof the image observed using the endoscope 1. FIG. 18 shows an enlargedview of a portion of the curve y=f(θ) shown in FIG. 17. Hunting will notoccur if the following equation, as illustrated in FIG. 18, issatisfied: ##EQU1## therefore ##EQU2## where,

β is a limit relative to the reference brightness value, of the allowedbrightness signal (i.e., the allowed brightness range is equal to thereference brightness signal ±β),

Δθ is a rotation angle at each motor driving operation, and

|dy/dθ| is a slope of a tangent [on a tangent] of the curve y=f(θ) atthe reference brightness value.

Further, the stepping motor 26 is considered to have no delay whendriven by the control system.

If the curve of y=f(θ) is a monotonically decreasing convex function,then as shown in FIG. 17, the absolute value of |dy/dθ| increases as θincreases. Therefore, if θ is relatively high, equation (a) above maynot be satisfied. In this case, the method of exciting the steppingmotor 26 is switched from 2 phase excitation to 1-2 phase excitation(i.e., excitation of the motor alternates between single phase and twophase, with each driving pulse). When the motor is driven with 1-2 phaseexcitation, the rotation angle Δθ₁ of the stepping motor 26 is equal toa half the rotation angle Δθ₂ when the motor is driven with 2 phaseexcitation. Therefore by driving the stepping motor 26 with 1-2 phaseexcitation, 2β/Δθ is doubled and equation (a) is satisfied.

For example, if one pulse is applied to the stepping motor 26 when using2 phase excitation, the resulting rotation angle Δθ₂ is 0.5 degrees, andβ equals 1. The right side of the equation (a) is therefore equal to 4.

According to the curve shown in FIG. 17, if θ is greater than 15degrees, |dy/dθ| is greater than four. Therefore, in the range where θis greater than 15 degrees, equation (a) is not satisfied. If the motorexcitation method is switched to 1-2 phase method, however, 2β/Δθ isequal to 8. According to the curve shown in FIG. 17, in the range whereθ is greater than 15 degrees, |dy/dθ| is less than 8. Therefore, byswitching the motor to have 1-2 phase excitation, equation (a) issatisfied when θ is greater than 15 degrees. Thus, since the change inbrightness per unit degree of rotation of the stepping motor 26 when 1-2phase excitation is employed is equal to half the change in brightnessper unit degree of rotation of the stepping motor 26 when 2 phaseexcitation is employed, the accuracy of the movement of the steppingmotor 26 is increased, and the hunting problem can be avoided.

FIG. 19 shows a flowchart of an interrupt routine for controlling thedriving of the stepping motor 26 according to a fourth embodiment of thepresent invention. In this embodiment, the PIT 44 is programmed suchthat the interrupt routine is executed every 30 Ms. Further, the mainprogram is the same program used in the first embodiment, and shown inFIG. 8.

In the fourth embodiment, a counter value c represents the cumulativenumber of pulses that have been applied to the stepping motor 26, and Prepresents a number of pulses to be applied to the stepping motor 26during one execution of the interrupt routine. The motor excitationmethod is given by the flag U2. If U2=0, then 2 phase excitation isused. If U2=1, then 1-2 phase excitation is used. Further, a value N isequivalent to the number of pulses applied to the motor 26 when equation(a) is satisfied, and Δc is a value by which the counter c isincremented.

In step S190, the phase of excitation of the stepping motor 26 isdetermined. FIG. 20A shows a flowchart of a process for determining anumber of phases of excitation of the stepping motor 26 according to thefourth embodiment.

Initially, in step S200, the counter value c is compared with thepredetermined value N. If c is not greater than N (S200:N), then stepS205 determines whether the stepping motor 20 has 2 phase excitation bychecking the setting of the flag U2. If U2 is equal to 1 (S205:Y), thenthe flag U2 is set to 0 and Δc is set equal to 2P, in step S206. Then,in step S207, the 2 phase excitation method is set. If the flag U2 isnot equal to 1 (S205:N), then steps S206 and S207 are skipped.

If the value of c is greater than N (S200:Y), then control proceeds tostep S202, which determines whether the stepping motor has 1-2 phaseexcitation by checking the setting of the flag U2. If U2 is equal to 0(S202:Y), then the flag U2 is set to 1 and Δc is set equal to P, in stepS203. Then, in step S204, the 1-2 phase excitation method is set. If theflag U2 is not equal to 0 (S202:N), then steps S203 and S204 areskipped.

In step S208, the brightness signal is received, and the brightnessvalue BV corresponding to the received brightness signal is determinedin step S209. Control then continues to step S191 of the flowchart shownin FIG. 19.

In step S191, the reference value RV is determined in accordance withthe input brightness level IBL set by the operator of the endoscope 1.Step S192 then determines whether the brightness value BV of thereceived brightness signal is within the allowed brightness range (i.e.,|RV-BV|>β).

If the brightness value BV is not within the allowed brightness range(S192:Y), the brightness value BV is compared with the reference valueRV, in step S193. Otherwise (S192:N), the routine is ended.

Then, if the brightness level is greater than the reference brightnesslevel (S193:Y), the forward drive pulse is sent, in step S194, and thecounter value c is incremented by Δc, in step S195. Otherwise (S193:N),the reverse drive pulse is sent in step S196, and the counter value c isdecremented by Δc, in step S197.

Step S198 then sends the predetermined number of pulses to the motor,and the routine is ended.

FIG. 21 is a table showing the relationship between the count c, theangle of rotation of the light shield 25, and the amount of lighttransmitted to the converging lens 24 from the light source 22. As shownin FIG. 21, when the count c is 0, the angle of rotation is 0°, and theamount of light transmitted is large. As the count c increases, theangle of rotation increases, and the amount of light transmitted becomessmaller. When the count c is 120, the angle of rotation is 30°, and theamount of light transmitted is small.

As described above, when the light shield 25 is rotated in order toreduce the amount of light transmitted, the method of exciting the motor26 is changed from 2 phase excitation to 1-2 phase excitation. Further,if the cumulative number of pulses that has been sent to the steppingmotor as counted by counter c is less than or equal to the predeterminedvalue N, then the stepping motor 26 is driven with 2 phase excitation.Therefore, the light shield 25 is initially rotated quickly. After thecumulative number of pulses has exceed the predetermined value N, thestepping motor 26 is driven with 1-2 phase excitation. Thus, the lightshield 25 is rotated in smaller steps, and therefore more accurately,during each successive interrupt. As a result of the control proceduredescribed above, the light shield 25 is rotated such that the amount oflight transmitted is changed quickly and accurately, while preventinghunting.

FIG. 20B shows a flowchart of a process for determining a number ofphases of excitation of the stepping motor 26 in step S190, according toa modified control of the fourth embodiment. The process carried out issimilar to that described above and shown in the flowchart of FIG. 20A,except that steps S208 and S209 are performed before the type ofexcitation of the motor has been determined. Further, an additional stepS201 is performed.

As shown in FIG. 20B, the brightness signal is received in step S208,and then the brightness value BV is determined in step S209. Then instep S200 the value of c is compared with the predetermined value N. Ifc is less than or equal to N (S200:N), steps S205 through S207 areexecuted as described above.

However, if c is greater than N (S200:Y), then step S201 is executedbefore step S202. In step S201, the value of BV is compared with apredetermined value M. The predetermined value M is smaller than theminimum reference value. If BV is greater than M (S201:Y), then stepsS205 through S207 are executed, and the stepping motor 26 is set to bedriven with 2 phase excitation. If BV is less than or equal to M(S201:N) then steps S202 through S204 are executed as described aboveand the stepping motor 26 is set to be driven with the 1-2 phaseexcitation.

As described above, in the modified fourth embodiment, even if thecumulative number of pulses as counted by counter c is larger than thepredetermined value N, if the brightness value BV is larger than thepredetermined value M, the stepping motor 26 is driven with 2 phaseexcitation. With this modified embodiment, in case the brightness valueis large, the stepping motor 26 will be driven with 2 phase excitationfor a longer time and therefore the time required to rotate the lightshield 25 such that the brightness value is brought into the allowedbrightness range is reduced. Further, when the value of BV is less thanM, the stepping motor 26 is driven with 1-2 phase excitation, andtherefore the accuracy of rotation of the light shield 25 remains highwhen the brightness value is near the allowed brightness range.

FIGS. 22 and 23 show a light shield 25M used in a second modification ofthe fourth embodiment described above. The light shield 25M is operatedwith the control of the flowcharts shown in FIGS. 19 and 20A.

In the second modification of the fourth embodiment, the light shield25M is planar and has a rectangular cross-section. Further, therelationship between the angle of rotation of the light shield 25M andthe A/D brightness signal y, illustrated in FIG. 24, is different thanthe relationship between the angle of rotation of the light shield 25and the A/D brightness signal y shown in FIG. 17.

As shown in FIG. 24, y=g(θ)

where, y is the brightness and

θ is the angle of the rotation.

The curve y=g(θ) is also a monotonically decreasing function. Further,|dy/dθ| generally decreases as θ increases.

Therefore, in the second modification of the fourth embodiment, thestepping motor 26 is driven with 1-2 phase excitation if the angle ofrotation θ is less than or equal to a predetermined angle, and 2 phaseexcitation if the angle of rotation θ is larger than the predeterminedangle. In this case the predetermined angle is equal to the angularposition of the stepping motor 26 when the counter value is equal to avalue N.

If the light shield 25M is driven with the control of the flowchartsshown in FIGS. 19 and 20B, the stepping motor 26 is driven with 1-2phase excitation when θ is less than or equal to a predetermined angle,and driven with 2 phase excitation when θ is greater than thepredetermined value. Further, if the brightness signal value exceeds themaximum reference value REFmax, (REFmax=161, see FIG. 25), then thestepping motor 26 is driven with 2 phase excitation regardless of thecounter value c.

FIG. 25 shows a graph of the brightness y of the object observed bythree different types of endoscopes, as a function of the angle ofrotation θ of the stepping motor 26. The endoscope A represents theendoscope 1 used for the digestive system, while endoscope C representsan endoscope used in the respiratory system. The difference in thebrightness characteristics of the endoscopes can be attributed to thedifferent f-numbers of the objective lenses and the different number ofoptical fibers used in the respective endoscopes.

As further shown in FIG. 25, the value of |dy/dθ| for the endoscope C issmall for all values of θ, and therefore the stepping motor 26 canalways be driven with 2 phase excitation.

Therefore, in a third modification of the fourth embodiment, the type ofendoscope is first transmitted to the video processor 20. If theendoscope 1 is a type A or B, then step S202 is performed as describedabove. However, if the endoscope is a type C, then control proceeds tostep S207, where the stepping motor 26 is set to be driven with 2 phaseexcitation.

According to the third modification of the fourth embodiment, the methodof driving the stepping motor 26 is determined in accordance with thetype of endoscope being used, the brightness of the observed image, andposition of the light shield 25. Therefore, the brightness of theobserved image can be adjusted quickly without causing hunting.

BRIGHTNESS LEVEL RANGE SETTING EMBODIMENTS

FIG. 26 shows a flowchart illustrating the control of the driving of thestepping motor 26 according to a fifth embodiment of the presentinvention. The fifth embodiment also operates using the main programshown in FIG. 8, with the interrupt being executed every 30 ms. Further,the number of pulses to be applied to the stepping motor 26 during eachinterrupt is 2. Therefore, after each interrupt, the stepping motor 26is rotated 1°.

In step S260, the brightness signal is received. Step S261 determinesthe brightness value BV of the brightness signal, and the referencevalue corresponding to an input brightness level IBL. Then, step S262determines whether the brightness value BV is greater than the referencevalue RV. If the brightness value BV is greater than the referencebrightness level RV (S262:Y), the forward drive signal is sent, in stepS263. Otherwise (S262:N), the reverse drive signal is sent in step S264.

A subroutine for determining the number of drive pulses to be sent tothe motor, is then called in step S265. After the number of drive pulseshas been determined and then sent to the motor, the routine is ended.

FIG. 27 is a table showing the relationship between the change in thebrightness signal value Δy and the rotation angle θ of the steppingmotor 26 which corresponds to the curve A of the graph in FIG. 25. Asshown in FIG. 27, the brightness levels are arranged into 5 groups, withthe change in brightness level Δy per degree of rotation of the lightshield 25, decreasing as the brightness level y increases.

FIG. 28 shows a partially enlarged view of the graph of FIG. 25. Asshown in FIG. 28, in order to adjust the light shield 25 such thathunting does not occur, the change in brightness signal value Δy perchange in rotation of stepping motor 26 during an interrupt (i.e., 1°)must be less than the allowed brightness range (i.e., 2β).

In the fifth embodiment, the allowable brightness ranges βn (n=1, 2, 3)are determined such that β1=2,β2=3, and β3=4. Further, the brightnessrange is selected in accordance with the input brightness level IBL setusing the switch panel 201. The range β1 is used when the selectedbrightness level is 10. If the selected input brightness level IBL is 9,8, or 7, then the range β2 is used. If the selected input brightnesslevel IBL is 6 or lower, then the range β3 is used.

As shown above, as the input brightness level IBL decreases, the allowedbrightness range βn increases, since the change in brightness per degreeof rotation is small when the brightness value BV is high, and is largewhen the brightness value BV is low, as shown in FIG. 25. Or in otherwords, |dy/dθ| increases as θ increases. By selecting the allowedbrightness range as described above, a quick response in rotation of thelight shield can be obtained without hunting.

FIG. 29 is a flowchart illustrating step S265 of FIG. 26, in accordancewith the fifth embodiment.

Step S290 determines whether the input brightness level IBL is equal to10. If the input brightness level IBL is equal to 10 (S290:Y), then stepS291 determines whether |RV-BV| is greater than β1 (i.e., two) If|RV-BV| is greater than β1 (S291:Y), then the predetermined number ofpulses (i.e., two) is applied to the stepping motor 26 in step S297.

If |RV-BV| is not greater than β1 (S291:N), then the subroutine ends,and the interrupt procedure shown in FIG. 26 is terminated.

If the input brightness level IBL is equal to 9, 8 or 7 (S290:N,S292:Y)), and |RV-BV| is greater than β2 (S293:Y), control proceeds tostep S297 where the predetermined number of pulses are applied to thestepping motor 26. However, if |RV-BV| is not greater than β2 (S293:N),then the subroutine ends and the interruption procedure is terminated.

If the input brightness level IBL is 6 or lower (S294:Y), and |RV-BV| isgreater than β3 (S295:Y), then control proceeds to step S297 where thepredetermined number of pulses are applied to the stepping motor 26. If|RV-BV| is not greater than β3 (S295:N), then the subroutine ends andinterruption procedure is terminated.

If the input brightness level IBL does not have a value between 1through 10 inclusive, then the input brightness level IBL is forciblyset to a default value, e.g., 5, in step S296, and the interruptionprocedure is terminated.

As described above, in the fifth embodiment, the number of drivingpulses sent to the stepping motor 26 is a constant number for all inputbrightness levels. However, the allowed brightness range P changes inaccordance with the input brightness level IBL.

FIG. 30 is a table showing the relationship between the angle ofrotation θ of the stepping motor 26 and the change in brightness levelΔy per degree of rotation of the stepping motor 26 according to amodified control of the fifth embodiment. This table also corresponds tothe curve A shown in FIG. 25. In the modified fifth embodiment, therange βn is changed in accordance with the angle of rotation θ of thestepping motor 26. Further, the number of pulses sent to the steppingmotor 26 is two.

FIG. 31 shows the motor driving subroutine according to the modifiedfifth embodiment, called in step S265 of the interrupt routine, shown inFIG. 26.

In step S310, if the angle of rotation θ is greater than or equal to θ₁(S310=Y), then step S311 determines whether |RV-BV| is greater than β4.If |RV-BV| is greater than β4 (S311:Y), then the predetermined number ofpulses (i.e., two) is applied to the stepping motor 26 in step S317. If|RV-BV| is not greater than β4 (S311 :N), then the subroutine ends, andthe interrupt procedure shown in FIG. 26 is terminated.

If the angle of rotation θ is greater than or equal to θ₂ (S310:N,S312:Y), and |RV-BV| is greater than β5(S313:Y), then the predeterminednumber of pulses are applied to the stepping motor 26 in step S317.However, if |RV-BV| is not greater than β5 (S313:N), then the subroutineends and the interruption procedure is terminated.

If the angle of rotation θ is greater than or equal to 0 (S312:N,S314:Y), and |RV-BV| is greater than β6 (S315:Y), then the predeterminednumber of pulses are applied to the stepping motor 26 in step S317. If|RV-BV| is not greater than β6 (S315:N), then the subroutine ends andinterruption procedure is terminated.

If the angle of rotation θ is less than 0 (S314:N), then the angle ofrotation θ is reset to 0, and the interruption procedure is terminated.

In the modified fifth embodiment, the allowed brightness ranges βn n areset such that β4=β5=3, and β6=2. Further, as described above, theallowed brightness range is set in accordance with the angular positionof the light shield 25.

FIG. 32 has tables showing the relationship between the angle ofrotation θ of the stepping motor 26 and the change in brightness levelΔy per degree of rotation of the stepping motor 26 according to a secondmodified control of the fifth embodiment. The tables A, B and Ccorrespond to the curves A, B and C, respectively, shown in FIG. 25.Curve A represents an endoscope used for the digestive system, curve Brepresents an endoscope used for the esophagus, and curve C representsan endoscope used for the respiratory system excluding the esophagus(i.e., such as the bronchial tubes, nose etc.).

In this embodiment, the range βn is changed in accordance with the angleof rotation θ of the stepping motor 26 and the type of endoscope.

FIG. 33 shows the motor driving subroutine according to the secondmodified control of the fifth embodiment, called in step S265 of theinterrupt routine, shown in FIG. 26.

Step S330 determines whether a type A endoscope is connected to thevideo processor 20. The endoscope type is stored in the memory 9, asdescribed before.

If the endoscope is a type A endoscope (S330:Y), then step S331determines whether the angle of rotation θ is greater than θ₃. If theangle of rotation θ is greater than θ₃, and |RV-BV| is greater than β7(S331:Y, S332:Y), then the predetermined number of pulses is sent to thestepping motor 26 in step S340, and the subroutine is ended. If |RV-BV|is not greater than β7 (S332:N), then the subroutine ends, and theinterrupt procedure is terminated.

If the angle of rotation θ is not greater than θ₃, and |RV-BV| isgreater than β8 (S331:N, S333:Y), then control proceeds to step S340where the predetermined number of pulses is sent to the stepping motor26. Otherwise (S334:N), the subroutine is ended, and the interruptprocedure is terminated.

If the endoscope is a type B endoscope (S330:N, S335:Y), then step S336determines whether the angle of rotation θ is greater than θ₄. If theangle of rotation θ is greater than θ₄, and |RV-BV| is greater than β9(S336:Y, S337:Y), then control proceeds to step S340 where thepredetermined number of pulses is sent to the stepping motor 26. If|RV-BV| is not greater than β9 (S337:N), then the subroutine ends, andthe interrupt procedure is terminated.

If the angle of rotation θ is not greater than θ4, and |RV-BV| isgreater than β10 (S336:N, S338:Y), then control proceeds to step S340where the predetermined number of pulses is sent to the stepping motor26. Otherwise (S338:N), the subroutine is ended, and the interruptprocedure is terminated.

When the endoscope is a type C endoscope (S335:N), step S339 determineswhether |RV-BV| is greater than β11. If |RV-BV| is greater than or equalto β11 (S337:Y) then the predetermined number of pulses is sent to thestepping motor 26, in step S340, and the subroutine is ended. Otherwise(S337:N), the subroutine is ended, and the interrupt procedure isterminated.

In the above described modified fifth embodiment, the allowed brightnessranges β7=4, β8=3, for the type A endoscope, β9=3, β10=2, for the type Bendoscope, and β11=2, for the type C endoscope. Further, the thresholdangle θ3=23° and the threshold angle θ4=200.

In the fifth embodiment described above, the number of pulses sent tothe stepping motor 26 remains constant, while the allowed brightnessrange varies in accordance with the input brightness level. A sixthembodiment will be described below, in which the allowed brightnessrange remains constant for all input brightness levels, but the numberof pulses sent to the stepping motor 26 is varied in accordance with theinput brightness levels.

FIG. 34 is a table showing the relationship between the change in thebrightness signal value Δy and the rotation angle θ of the steppingmotor 26 according to a sixth embodiment of the present invention. Asshown in FIG. 34, the brightness levels are arranged into 3 groups, withthe change in brightness level Δy per degree of rotation of the lightshield 25, decreasing as the brightness level y increases. In the sixthembodiment, the stepping motor 26 is rotated by 0.5° when one drivepulse is applied.

FIG. 35 shows a partially enlarged view of the graph of FIG. 25. Asshown in FIG. 35, in order to adjust the light shield 25 such thathunting does not occur, the change in brightness signal value Δy perchange in rotation of stepping motor 26 during an interrupt (i.e., 0.5°)must be less than the allowed brightness range (i.e., 2β).

The sixth embodiment operates using the main program shown in FIG. 8,and the interrupt routine shown in FIG. 26.

FIG. 36 shows the subroutine according to the sixth embodiment, calledin step S265 of the interrupt routine, shown in FIG. 26. In the sixthembodiment, the allowed brightness range, 2β is set equal to 6.

Step S360 determines whether the brightness value is within the allowedbrightness range (i.e., |RV-BV|>β). If the brightness value is withinthe allowed brightness range (S360:N), then the subroutine is ended, andthe interrupt routine is ended. Otherwise (S360:Y), if the inputbrightness level IBL is equal to 10 in step S361, then the steppingmotor 26 is driven with P1 pulses, in step S362, and the subroutine isended. In the sixth embodiment, P1=3.

If the input brightness level IBL is not equal to 10(S361:N) but one of9, 8 or 7, in step S363, then the stepping motor 26 is driven with P2pulses, in step S364, and the subroutine is ended. In the sixthembodiment, P2=2. If the input brightness level IBL is less than orequal to 6(S363:N), in step S365, then the stepping motor 26 is drivenwith P3 pulses, in step S366, and the subroutine is ended. In the sixthembodiment, P3=1.

If the brightness level is not set, or is erroneously set to a valueoutside the range 1 through 10, then the input brightness level IBL isset to 5 in step S367, and the routine ends.

As described above, the stepping motor 26 is driven with a higher numberof pulses when the input brightness level IBL is high than when theinput brightness level IBL is low. Therefore, the control of therotation of the light shield 25 can be optimized depending on thedesired input brightness level IBL.

FIG. 37 is a table showing the relationship between the change in thebrightness signal value Δy and the rotation angle θ of the steppingmotor 26 according to a modified control of the sixth embodiment. Asshown in FIG. 37, the change in brightness level Δy per degree ofrotation of the light shield 25 increases as the angle of rotation θ ofthe stepping motor 26 increases. In the modified sixth embodiment, thestepping motor 26 is rotated by 0.5° when one drive pulse is applied.Further, the number of pulses to be applied to the stepping motor 26changes in accordance with the angle of rotation θ of the stepping motor26.

FIG. 38 shows the subroutine according to the modified control of thesixth embodiment, called in step S265 of the interrupt routine, shown inFIG. 26.

Step S380 determines whether the brightness value is within the allowedbrightness range (i.e., |RV-BV|>β). If the brightness value is withinthe allowed brightness range (S380:N), then the subroutine is ended, andthe interrupt routine is terminated. Otherwise (S380:Y), if the angle ofrotation θ is greater than θ₁, in step S381, then the stepping motor 26is driven with P4 pulses, in step S382, and the subroutine is ended. Inthis embodiment, P4=1, and θ₁ =23°.

If the angle of rotation θ is less than θ₁ (S381 :N), but greater thanθ₂ in step S383, then the stepping motor 26 is driven with P5 pulses, instep S384, and the subroutine is ended. In this embodiment, P5=2, and θ₂=16°.

If the angle of rotation θ is less than θ₂ (S383:N), but greater than 0°in step S385, then the stepping motor 26 is driven with P6 pulses, instep S386, and the subroutine is ended. In this embodiment, P6=3.

If the angle of rotation θ is not set, or is erroneously set to a valueoutside the range, then the angle of rotation θ is set equal to 0° instep S387, and the routine ends.

As described above, the stepping motor 26 is driven with a higher numberof pulses when the angle of rotation θ is low, than when the angle ofrotation θ is high. Therefore, the control of the rotation of the lightshield 25 can be optimized depending on the desired angle of rotation θ.

FIG. 39 shows a table of the relationship between the change in thebrightness signal value Δy and the rotation angle θ of the steppingmotor 26 for each of the endoscopes A, B and C, according to a secondmodified control of the sixth embodiment. As shown in FIG. 39, thechange in brightness level Δy per degree of rotation of the light shield25 increases as the angle of rotation θ of the stepping motor 26increases. In this modified embodiment, the stepping motor 26 is rotatedby 0.5° when one drive pulse is applied. Further, the number of pulsesto be applied to the stepping motor 26 changes in accordance with theangle of rotation θ of the stepping motor 26.

FIG. 40 shows a flowchart of the subroutine according to the secondmodified control of the sixth embodiment, called in step S265 of theinterrupt routine, shown in FIG. 26.

Step S400 determines whether the brightness value is within the allowedbrightness range (i.e., |RV-BV|>β). If the brightness value is withinthe allowed brightness range (S400:N), then the subroutine is ended, andthe interrupt routine is ended. Otherwise (S400:Y), step S401 determineswhether a type A endoscope is connected to the video processor 20. If atype A endoscope is connected (S401:Y) and the angle of rotation θ isgreater than θ₃, in step S402, then the stepping motor 26 is driven withP7 pulses, in step S403, and the subroutine is ended. In thisembodiment, P7=1, and θ₃ =23°.

If the angle of rotation θ is less than θ₃ (S401 :N), then the steppingmotor 26 is driven with P8 pulses, in step S404, and the subroutine isended. In this embodiment, P8=2.

If a type A endoscope is not connected to the video processor 20(S401:N), then step S405 determines whether a type B endoscope isconnected. If a type B endoscope is connected (S405:Y) and the angle ofrotation θ is greater than θ₄, in step S406, then the stepping motor 26is driven with P9 pulses, in step S407, and the subroutine is ended. Inthis embodiment, P9=2, and θ₃ =20°.

If the angle of rotation θ is less than θ₄ (S406:2), then the steppingmotor 26 is driven with P10 pulses, in step S408, and the subroutine isended. In this embodiment, P10=3.

However, if a type C endoscope is connected, then the stepping motor 26is driven with P11 pulses, in step S409, for all angles of rotation θ.In this embodiment, P11=4.

Thus, as described above, the number of pulses to be sent to the motoris determined in accordance with the type of endoscope and the angle ofrotation of the light shield 25.

In the six embodiments described above, the light shield 25 is rotatedby the stepping motor 26 in order to vary the amount of light emitted bythe lighting unit. Then, the brightness value BV of the receivedbrightness signal is detected, and a determination is made as to whetherthe light shield 25 should be adjusted. Therefore, the interval at whichthe interrupt may be executed is limited by the mechanical constructionand stability of the light amount controlling device.

The seventh embodiment described below employs an electronic feedbackcontrol of the light amount controlling device. Therefore, the intervalbetween successive interrupts can be shortened, and thus the lightamount controlling device can be adjusted more quickly.

ELECTRONICALLY CONTROLLED EMBODIMENT

FIGS. 41 and 42 are flowcharts illustrating the drive control of thestepping motor 26 according to the seventh embodiment. The drive controlof the stepping motor 26 is an interrupt procedure executed at apredetermined interval. In the seventh embodiment, the predeterminedinterval is 20 ms. The number of pulses applied to the stepping motor 26is either one or two.

In the seventh embodiment, four storage registers q1 through q4 areused. As shown in FIG. 43, the register q1 is an eight-bit shiftregister with the least significant bit (i.e., q1_(L)) indicatingwhether the brightness value BV of the received image signal is greaterthan the reference value RV. If the brightness value BV is greater thanthe reference value RV, then q1_(L) is set equal to 1, otherwise q1_(L)is set equal to 0.

When the subsequent interrupt procedure is executed, the value in theq1_(L) is shifted to the next highest order bit (i.e., shifted to theleft). The received brightness value BV and the reference value RV arethen compared as described above and q1_(L) is set with the appropriatevalue. Thus, the register q1 stores the result of the comparison of thebrightness value BV and the reference value RV, for eight consecutiveinterrupts. Further, the data of the most significant bit of thevariable will be lost when the register is shifted to the left.

The register q2 is also an eight-bit register with the least significantbit q2_(L) indicating whether the stepping motor 26 has been rotated ina forward or reverse direction during the currently executed interruptprocedure. If the stepping motor 26 is rotated in the forward direction,then q2_(L) is set to 0, otherwise q2_(L) is set to 1. When the steppingmotor 26 is not driven, q2_(L) is set to 0.

When the subsequent interrupt procedure is executed, the value in theq2_(L) is shifted to the next highest order bit (i.e., shifted to theleft). Thus, the register q2 stores the value indicating the directionof rotation of the stepping motor 26 for eight consecutive interrupts.Further, the data of the most significant bit of the variable will belost when the register is shifted to the left.

The register q3 is a one-bit register variable representing whether thelight shield 25 is in a hunting condition. The register q3 is set to 0if the light shield 25 is being normally driven. If the light shield 25is in a hunting condition, then the register q3 is set to 1.

The register q4 is used to indicate the direction of rotation of thestepping motor 26 during the last interrupt procedure. If the steppingmotor 26 was driven in the forward direction, then q4 will be set to 0,otherwise (i.e., for the reverse direction) q4 is set to 1.

As shown in FIGS. 41 and 42, the brightness signal is received, in stepS410. In step S411, the brightness value BV and reference value RV aredetermined. Step S412 then checks the value of the register q3 todetermine whether hunting is occurring.

If q3 is equal to Q, then hunting is occurring. In this embodiment Q isequal to 1. If hunting is occurring (i.e., q3=1, S412:Y), step S418determines whether the absolute value of the difference between thereference value RV and the brightness value BV is greater than apredetermined value PV (e.g., 8). If |RV-BV|>PV, then q3 is set to 0, instep S419, and the interrupt procedure is terminated. Otherwise(S418:N), the interruption procedure is terminated. Therefore, the lightshield 25 is not driven during the current interrupt, however, bysetting q3 equal to 0, it is possible to drive the light shield 25during the next interrupt, even if hunting is currently occurring.

If hunting is not occurring (i.e., q3=0, S412:N), step S413 determineswhether the brightness value BV is greater than the reference value RV.If the brightness value BV is greater than the reference value RV(S413:Y), then q1_(L) and q2_(L) are set to 0, in step S414, and theforward rotation instruction signal is sent to the stepping motor 26 instep S415. However, if the brightness value BV is not greater than thereference value RV (S413:N), then q1_(L) and q2_(L) are set to 1, instep S416, and the reverse rotation instruction signal is sent to thestepping motor 26 in step S417. The forward or reverse instructionsignals are signals for determining the rotation direction of thestepping motor 26. The stepping motor 26 is not rotated in steps S415 orS417, but is rotated when it receives a motor driving pulse.

Continuing in FIG. 42, in step S420 each bit of the registers q1 and q2is checked. If at least one of the registers q1 or q2 has the bits ofits register alternating between "1" or "0", then step S421 determinesthat hunting is occurring. Further, this decision may be made bychecking only one of the registers q1 or q2.

If it is determined that hunting is not occurring, control proceeds tostep S423, otherwise all of the bits of the registers q1 and q2 are setat 0, and the register q3 is set to 1, in step S422.

Step S423 determines whether the brightness value BV is in the allowedbrightness range (i.e., |RV-BV|>β,β having a value of 3 for example),where RV ±β is the allowed brightness range. If |RV-BV|>β (S423:N), thenstep S428 sets q2_(L) equal to 0, and the routine is ended. Otherwise(S423:Y), step S424 determines whether q2_(L) is equal to 0. If q2_(L)is equal to 0 (S424:Y), then q4 is set equal to 0, in step S425.Otherwise (S424:N), q4 is set equal to 1, in step S426.

Then in step S427 a driving pulse is sent to the stepping motor 26 andthe routine ends.

As described above, in the seventh embodiment, by examining theregisters q1 and/or q2, the occurrence of hunting can be determined.Therefore, since the examination of the registers q1, q2 is performedelectronically, the determination as to whether hunting is occurring canbe made quickly.

Further, as described above, when hunting is occurring, no pulses aresent to the stepping motor 26 and thus the stepping motor 26 is notnormally driven. However, if the difference in brightness (|BV-RV|) isgreater than the predetermined value PV, the value of q3 is set to 0,and the stepping motor 26 can be driven during the next interruptprocedure. This reduces the amount of time required to rotate the lightshield 25.

FIG. 44 shows a flowchart of the drive control procedure of the steppingmotor 26 according to a modification of the seventh embodiment of thepresent invention. The modified seventh embodiment is similar to theseventh embodiment described above, except that the processing stepsS440 through S446 are performed before the interrupt procedure shown inFIGS. 41 and 42 is executed.

Step S440 receives the image signal from the image processing circuit21. Then step 441 determines the brightness value BV of the image signaland the reference value RV. Step S442 determines whether the value ofthe register q4 is equal to 0. If q4 is equal to 0, then the motor wasrotated in the forward direction, and control proceeds to step S444,which determines whether the brightness value BV has decreased. If thebrightness value BV has decreased (S444:Y), then control proceeds tostep S446. Otherwise (S444:N), control proceeds to step S445 whichdetermines whether the difference between the brightness value BV andthe reference value RV is greater than the predetermined value PV. If|RV-PV|>BV (S445:Y), then control proceeds to step S446. Otherwise(S445:N), the routine is terminated.

In the case that q4 is not equal to 0 (S442:N), step S443 determineswhether the brightness value BV has increased. If the brightness valueBV has increased (S443:Y), then control proceeds to step S446. Otherwise(S443:N), step S445 determines whether the difference between thebrightness value BV and the reference value RV is greater than thepredetermined value PV (PV being 10, for example). If |RV-BV|>PV(S445:Y), then control proceeds to step S446. Otherwise (S445:N), theroutine is terminated.

At step S446, steps S412 through S424 of the flowchart of FIGS. 41 and42, are performed.

According to the modification of the seventh embodiment, when thebrightness value BV does not change after the stepping motor 26 hasrotated the light shield 25 (e.g. as a result of mechanical delay inrotating the light shield 25), if the difference between the brightnessvalue BV and the reference value RV is greater than the predeterminedvalue PV, the motor drive signal is sent to the driving circuit 28. Thisreduces the amount of time required to locate the light shield 25, inthe cases that the difference in brightness (|BV-RV|) is greater thanthe predetermined value PV.

If the difference (|BV-RV|) is not greater than the predetermined valuePV, the motor drive signal is not sent to the driving circuit 28.

In the modified seventh embodiment, the register q4 is employed toeasily determine the direction that the motor was driven during theprevious interrupt. However, by examining q2_(L) in step S442, the sameresult can be achieved.

FIGS. 41 and 45 show a flowchart of a drive control procedure of thestepping motor 26 according to an eighth embodiment of the presentinvention. The eighth embodiment is similar to the seventh embodimentdescribed above. However, in the eighth embodiment, the interval betweensuccessive interrupts is 50 ms. Further, the register q3 is a two bitregister. If the light shield 25 is driven normally, q3 has the value 0.If hunting occurs, and the number of motor drive pulses is high (i.e., 5through 10), then q3 is set equal to 1. If hunting occurs, and thenumber of motor drive pulses is low (i.e., 1 or 2), then q3 is set equalto 2.

Therefore, in the eighth embodiment the value of Q is 2, and step S412determines whether q3 is equal to 2. Further, the interval betweensuccessive interrupts is 50 ms. Still further, the number of pulsesapplied to the motor during an interrupt can be made small or large.

In the eighth embodiment, after the patterns of the registers q1 and q2have been checked in step S420, if one of the registers q1, q2 has analternating pattern of "1"s and "0"s, then step S451 determines thathunting is occurring. If hunting is occurring (S451:Y), q1 and q2 areset to 0 in step S452. Step S453 checks whether q3 is set equal to 0. Ifq3 is set to 0 (S453:Y), then q3 is set equal to 1 in step S454.Otherwise (S453:N), q3 is set equal to 2 in step S455, and controlproceeds to step S456. If hunting is not occurring (S451:N), thencontrol proceeds to step S456.

Step S456 determines whether |RV-BV|>β, where RV±β, where RV±β is theallowed brightness range. If the difference is within the allowedbrightness range (S456:N), then q2_(L) is set equal to 0 in step S460,and the routine is terminated.

If the difference is not within the allowed brightness range (S456:Y),then step S457 determines whether q2_(L) is equal to 0. If q2_(L) isequal to 0 (S457:Y), then q4 is set equal to 0, in step S458. Otherwise(S458:N), q4 is set equal to 1, in step S459.

Step S461 determines whether q3 is equal to 0. If q3 is equal to 0(S461:Y), then 5 or more driving pulses are sent to the stepping motor26 in step S463, and the routine is terminated. Otherwise (S461:N), onlyone or two driving pulses are sent to the stepping motor 26 in stepS462, and the routine is terminated.

As described above, in the eighth embodiment, if the number of drivepulses sent to the stepping motor 26 is large, and hunting is occurring,then in the next interrupt procedure the number of drive pulses is madesmaller and the driving of the stepping motor 26 is continued. However,if the number of drive pulses sent to the stepping motor 26 is small,and hunting is still occurring, then no drive pulses are sent to thestepping motor 26.

Thus, with this control, the stepping motor 26 is initially driven witha large number of driving pulses in order to quickly rotate the lightshield 25. Then, if hunting occurs, the number of drive pulses isreduced, and the motor driving is continued. Therefore, the light shield25 can be rotated with high speed and accuracy.

FIGS. 46A and 46B show a flowchart of the drive control procedure of thestepping motor 26 according to a modification of the eighth embodimentof the present invention. The modified eighth embodiment is similar tothe modified seventh embodiment shown in FIG. 44, and described above.

As shown in FIG. 46A, the same steps S440 through S445, shown in FIG.44, are executed. However, in step S443, if BV increased (S443:Y) thencontrol proceeds to step S447. In step S447 the steps S412 through S420and S451 through S462, shown in FIGS. 41 and 45 are executed. Similarly,in step S444, if BV decreases, control also goes to step S447. Afterstep S447 is executed the interrupt procedure is terminated. Further, instep S445, if |RV-BV|>PV, then step S447 is executed. Otherwise(S445:N), control proceeds to step S448, where steps S412 through S420are performed. Then steps S451 through S462 as shown in FIG. 46B areexecuted. These steps are similar to the steps shown in FIG. 45.However, in the modified eighth embodiment, after q4 has been set to 0in step S458 or q4 has been set to 1 in step S459, step S462 isexecuted.

Therefore in the modified eighth embodiment, when the brightness valueBV does not change after the stepping motor 26 has rotated the lightshield 25 (e.g. as a result of mechanical delay in rotating the lightshield 25), if |RV-BV| is greater than the PV, a relatively large numberof motor driving pulses is sent to the driving circuit 28. However, if|BV-RV| is not greater than PV, but is greater than β, a relativelysmall number of motor driving pulses is sent to the driving circuit 28.In this case, the value of q3 has no effect on the number of drivingpulses sent to the motor.

In the eighth embodiments described above, a single light shield 25 wasemployed in order to vary the amount of light emitted by the lightingunit. In the ninth embodiment described below, two light shields areemployed.

TWO LIGHT SHIELD EMBODIMENT

FIG. 47 shows a schematic diagram of the construction of the endoscopeaccording to the ninth embodiment of the present invention. Theconstruction of ninth embodiment is similar to the construction of thefirst embodiment shown in FIG. 1, with the common elements having thesame reference numbers.

As shown in FIG. 47, the video processor 120 has the light shield 25arranged to be rotated by the stepping motor 26 along a vertical axis,in a similar manner to the first embodiment. The video processor 120also includes a light shield 125 arranged to be rotated by a steppingmotor 126 along a horizontal axis. The light shield 125 is positionedbetween the lamp 22 and the light shield 125. The motor control circuit28 controls the operation of the stepping motor 25 and the steppingmotor 125. Information related to an operation of the endoscope 1 isinput using the switch panel 201.

FIG. 48 shows a perspective view of the light shields 25 and 125. Thelight shields 25, 125 have a U-shape, and are rotated about the verticaland horizontal axes, respectively, by the stepping motors 26 and 126.Further, the light shields 25, 125 have the same size.

The light shield 25 varies the size of the light path L in thehorizontal direction, while the light shield 125 varies the size of thelight path L in the vertical direction. Thus, the amount of light whichenters the optical fiber 4 can be controlled quickly and accurately.

The brightness level can be selected from amongst ten levels 1 through10, using the switch panel 201. The selected brightness level is read bya microprocessor 130, and determines which of the light shields 25, 125is to be rotated. Further, the direction of rotation and amount ofrotation of the selected light shield is also determined by themicroprocessor 130.

FIG. 49 is a block diagram illustrating the controller 130. As shown inFIG. 49, the microprocessor 130 includes an operation control circuit131, a direction control circuit 132 and a motor selection circuit 133.The operation control circuit 131 receives a brightness value from theswitch panel 201. Further, the integrated output of the CCD 3 is outputfrom the integration circuit 109 to the operation control circuit 131.The operation control circuit 131 compares the brightness of theintegrated CCD signal with a reference brightness level corresponding tothe brightness level input from switch panel 201.

Based on the comparison of the two signals, the operation controlcircuit 131 controls the direction control circuit 132 to output aforward or reverse drive signal to the motor control circuit 28.Further, the operation control circuit 131 controls the motor selectioncircuit 133 to output a motor select signal to the motor control circuit28. The motor control circuit 28 controls the operation of the motors 26and 126 in accordance with the signals received from the directioncontrol circuit 132 and the motor selection circuit 133.

The operation control circuit 131, the direction control circuit 132,and the motor selection circuit 133 may be implemented as discretehardware units. Alternatively, the functions of these blocks may beimplemented in software using a CPU, RAM, and a ROM etc.

FIG. 50 illustrates a flowchart of the drive control procedure of thestepping motors 26 and 126, according to the ninth embodiment. In thisembodiment, the interrupt procedure is executed every 50 ms.

At step S500, the brightness signal is received from the CCD. Step S501determines the brightness value BV and the reference value RV. Step S502determines whether the difference between the received brightness valueBV and the reference value RV is greater than an allowed brightnessrange β. If |RV-BV| is not greater than β (S502:N), then the routine isterminated. Otherwise (S502:Y), control proceeds to step S503 whichdetermines whether |RV-BV| is greater than another allowed brightnessrange β1, where β1 is greater than β. If |RV-BV| is greater than β1(S503:Y), then the motor selection circuit 133 selects both steppingmotors 26, 126 to be driven by the motor control circuit 28, in stepS504. Otherwise (S503:N), the motor selection circuit 133 selects onlystepping motor 126, to be driven by the motor control circuit 28, instep S504.

After the motor to be driven has been selected, step S507 determineswhether the brightness value BV is greater than the reference value RV.If the brightness value BV is greater than the reference value RV(S507:Y), then the forward pulse is sent to the stepping motor(s) 26,126 in step S508. Otherwise (S507:N), the reverse pulse is sent to thestepping motor(s) 26, 126 in step S509. Then a predetermined number ofpulses is sent to the stepping motor(s), in step S510, and the routineis ended.

As described above, if the difference between the brightness value andthe reference value is larger than the allowed brightness range β1, thenboth stepping motors 26, 126 are driven to adjust the amount of lightemitted by the lighting unit. Therefore, the amount of light can beadjusted quickly and accurately. Further, by using two light shields 25,125, the amount of light can be adjusted quickly, while at the same timethe number of pulses sent to the stepping motors 26, 126 can be keptlow. Thus, the hunting problem can be avoided.

FIG. 51 shows a modification of the ninth embodiment. In thismodification, the light shield 25a is designed such that the length ofside B is longer than the length A of the corresponding side of thelight shield 125. With this construction, when the light shield 25a isrotated, the change in the amount of light is greater than when thelight shield 125 is rotated.

FIG. 52 illustrates a flowchart of the drive control procedure of thestepping motors 26 and 126, according to the modified ninth embodiment.This is similar to the flowchart shown in FIG. 50 with steps S500through S510 being executed. However, at step S503, if |RV-BV|>β1, thenstep S506 is executed instead of step S504. In step S506, only the motor26 is selected to be driven by the motor control circuit 28.

Thus, as described above, if the difference between the brightness valueand the reference value is larger than the allowed brightness range β1,then the stepping motor 26 is driven to adjust the amount of light.Therefore, the amount of light can be adjusted quickly and accurately,since rotation of the light shield 25a has a greater effect on thechange in the amount of light than the rotation of the light shield 125.Further, by using two light shields 25a, 125, each one having adifferent effect on the amount of light, the amount of light can beadjusted quickly, while at the same time entering that the number ofpulses sent to the stepping motors 26, 126 can be kept low. Thus, thehunting problem can be avoided.

The present disclosure relates to subject matter contained in JapanesePatent Application Nos. HEI 6-185832 filed on Aug. 8, 1994; HEI 6-196362filed on Aug. 22, 1994; HEI 6-196363 filed on Aug. 22, 1994; HEI6-196364 filed on Aug. 22, 1994; HEI 6-196365 filed on Aug. 22, 1994;HEI 6-200682 filed on Aug. 25, 1994; and HEI 6-203164 filed on Aug. 29,1994; which are expressly incorporated herein by reference in itsentirety.

We claim:
 1. A device for controlling an amount of light of a lightingunit for use in an endoscope, said endoscope being used to view an imageof an object, said device comprising:means for shielding light generatedby a light source and transmitted to said endoscope; a stepping motorfor driving said light shielding means by a predetermined driving amountfor a plurality of time intervals; and means for setting a duration ofsaid plurality of time intervals to have one of a plurality of timevalues.
 2. The device according to claim 1, further comprising a systemthat detects a type of said endoscope, wherein said setting means setssaid duration of said time interval in accordance with said type of saidendoscope detected by said detecting system.
 3. The device according toclaim 1, wherein said setting means comprises a manually operableswitch, said setting means setting said duration of said time intervalin response to a position of said switch.
 4. A device that controls anamount of light of a lighting unit for use in an endoscope, saidendoscope being used to view an image of an object, said devicecomprising:a shield member; a stepping motor; and a setting system; saidshielding member shielding light generated by a light source andtransmitted to said endoscope, said stepping motor driving said lightshielding member by a predetermined driving amount for a plurality oftime intervals, and said setting system setting a duration of saidplurality of time intervals to have one of a plurality of time values.5. The device according to claim 4, further comprising a detectingsystem that detects a type of said endoscope, wherein said settingsystem sets said duration of said time interval in accordance with saidtype of said endoscope detected by said detecting system.
 6. The deviceaccording to claim 4, wherein said setting system comprises a manuallyoperable switch, said setting system setting said duration of said timeinterval in response to a position of said switch.